<?
require_once("../../../class2.php");
require_once("../includes/require_all.php");

if(USERNAME!="USERNAME" AND $_POST['text']!=''){
	$texted = $_POST['text'];
	$filed = $_GET['fileas'];
	$dated= months_inBG(date("d F : H:i"), 2);
	$spokenby= USERNAME;
	if (in_array(USERNAME,$adminss)) { $spclass="textRED"; }
	elseif (in_array(USERNAME,$additionaltoadmins)) { $spclass="textGREEN"; }
	elseif (in_array(USERNAME,$trainees)) { $spclass="textYELLOW"; }
	
	$fp = fopen("logs/$filed.html", 'a+');
	fwrite($fp, "<div class='msgln'><span class='cdate'>$dated</span> <span class='$spclass'>$spokenby</span> ".stripslashes(htmlspecialchars($texted))."</div>\n");
	fclose($fp);
}
?>